home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / etc / acpi / suspend.d / 60-generate-modules-list.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2009-03-27  |  792 b   |  31 lines

  1. #!/bin/sh
  2.  
  3. for x in /sys/module/*_ircc /sys/module/*_ircc2; do
  4.     x=`basename $x`
  5.     # nsc_ircc is safe over suspend/resume
  6.     if [ $x != "nsc_ircc" ]; then
  7.     modprobe -r $x 2>/dev/null;
  8.     # These don't get added to the reload list, since irda startup will
  9.      # do that
  10.     fi
  11. done
  12.  
  13. if [ -d /sys/module/ndiswrapper ]; then
  14.         modprobe -r ndiswrapper
  15.         MODULES="$MODULES ndiswrapper"
  16. fi
  17.  
  18. # This is not guaranteed to work - several drivers appear to use names that
  19. # are not the same as their module name
  20. for x in /sys/class/net/*; do
  21.     if [ -e $x/device/driver ]
  22.         then
  23.         MODULES="$MODULES $(basename $(readlink $x/device/driver) | tr [:upper:\] [:lower:])"
  24.     fi
  25. done
  26.  
  27. if [ -d /sys/module/netconsole ]; then
  28.     rmmod netconsole
  29.     MODULES="$MODULES netconsole"
  30. fi
  31.